package com.somlsis.dialog


import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.DialogFragment
import com.somlsis.R


class MotionDialog(val listener: OnMotionButtonClickListener) : DialogFragment() {
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val inflate = inflater.inflate(R.layout.dialog_motion, container)
        val confirm = inflate.findViewById<TextView>(R.id.confirm)
        val cancel = inflate.findViewById<TextView>(R.id.cancel)
        confirm.setOnClickListener {
            listener.onConfirmClick()
            dismiss()
        }
        cancel.setOnClickListener{
            listener.onCancelClick()
        }
        return inflate
    }

    interface OnMotionButtonClickListener {
	    fun onConfirmClick()
	    fun onCancelClick()
    }
}